<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body onload="">
        <?php
            $idToEdit = $_POST['wdToEditId'];
            $rowToEdit = $_POST['wdToEditRowId'];
            $newNotes = $_POST['wdEditNotes'];
            $newHours = $_POST['wdEditHours'];
            print("<script type='text/javascript'>
                    rowToEdit = $rowToEdit;
                    notes = \"$newNotes\";
                    hours = $newHours;
                    </script>");
            include "Datasource.php";
            include "WorkDone.php";
            include "WorkDoneDao.php";
            include "EmployeeDAO.php";
            include "Employee.php";
            $conn = new Datasource("localhost", "theanykey", "root", "");
            $objWdDAO = new WorkDoneDao();
            $objWdToEdit = new WorkDone();
            $objWdToEdit = $objWdDAO->getObject($conn, $idToEdit);
            if($objWdToEdit)
            {
                $objWdToEdit->setNotes($newNotes);
                $objWdToEdit->setHrsWorkDone($newHours);
                if(true)//$objWdDAO->save($conn, $objWdToEdit))
                {
        ?>
    <script type="text/javascript">
        otherWindow = window.opener;
        editRow = otherWindow.document.getElementById("rowWorkDoneOld" + rowToEdit);
        notesElement = editRow.childNodes[7];
        hoursElement = editRow.childNodes[9];
        notesSpan = notes;
        notes = notes.length > 20 ? notes.substr(0, 20) + "..." : notes;
        notesElement.innerHTML = notes;
        notesElement.title = notesSpan;
        hoursElement.innerHTML = hours;
        window.close();
    </script>

    <?php
    }//end results if
}//end if
    ?>
</body>
</html>
